package org.xy.yq.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.xy.yq.dao.ICityDao;

import org.xy.yq.entity.City;
import org.xy.yq.service.ICityService;

import java.util.List;


@Service("cityServiceImpl")
public class CityServiceImpl implements ICityService {
    @Autowired
    @Qualifier("cityDaoImpl")
    private ICityDao cityDao;
    @Override
    public boolean insertCity(City city) {
        boolean flag = true;
        try{
            cityDao.insertCity(city);
        }catch (Exception e){
            flag =false;
        }
        return flag;
    }

    @Override
    public List<City> getCity(String province) {
        return cityDao.getCity(province);
    }

    @Override
    public List<City> top5() {
        return cityDao.top5();
    }
}
